package com.gzdh.tang.modu.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.gzdh.tang.dishrecognition.dto.DiningTableListDto;
import com.gzdh.tang.dishrecognition.dto.ReserveListDto;
import com.gzdh.tang.modu.entity.Fk;
import com.gzdh.tang.modu.entity.MacMainpSbruan;
import com.gzdh.tang.modu.entity.Reserve;
import com.gzdh.tang.modu.entity.TangDevice;
import com.gzdh.tang.modu.model.FoodBean;
import com.gzdh.tang.modu.vo.InStockTempVo;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface ReserveService extends IService<Reserve> {

    /**
     * 刷卡支付
     *
     * @param deviceId
     * @param price
     * @param reqSeqNo
     */
    public String toCardPay(String deviceId, int price, Fk fk, String reqSeqNo, List<FoodBean> foodBeanList) throws RuntimeException;

    public Fk toCardPay2(String deviceId, int price, Fk fk, String reqSeqNo, int type, Date date) throws RuntimeException;

    public Fk toPayByYouXin(String deviceId, int price, Fk fk, String reqSeqNo, int type, Date date) throws RuntimeException;

    public void toPayByCardNo(String deviceId, int price, String cardno, String reqSeqNo,int orderCount) throws RuntimeException;


    public void toPayByAli(String device, int price, String cardno, String reqSeqNo) throws RuntimeException;

    public String toPayByWeixin(String deviceId, int price, String reqSeqNo) throws RuntimeException;

    /**
     * 仓库IC 卡支付
     *
     * @param tangDevice
     * @param inStockTempVo
     * @param fk
     * @param orders
     * @param sc
     */
    void depotCardPay(TangDevice tangDevice, List<InStockTempVo> inStockTempVo, Fk fk,
                      String orders, String sc, String fl);


    boolean insertReserve(String rgTermSN, String reqSeqNo, int price,
                          int sl, Fk fk, MacMainpSbruan macMainpSbruan,
                          String hName, String code, BigDecimal cardPrice, String sc, String orders, Date date) throws RuntimeException;

    boolean insertReserve(String rgTermSN, String reqSeqNo, int price,
                          int sl, Fk fk, MacMainpSbruan macMainpSbruan,
                          String hName, String code, BigDecimal cardPrice, String sc, String orders, Date date, int orderCount) throws RuntimeException;

    int payCounts(String cardno, String dinner);

    List<ReserveListDto> getOrderList(String startTime, String endTime, String deviceId);

    String drRefundProduct(String orders) throws RuntimeException;

    String priceReserve(String cardno, String dinner);


    /**
     * 核销reservce，如果存在则标志为已打印，并返回成功状态
     *
     * @param cardno
     * @return
     */
    Map<String, String> hexiaoReserve(int cardno, String dinner);

    void toRollback(String reqSeqNo) throws RuntimeException;

    List<DiningTableListDto> getDiningTableList(Integer type, String startTime, String endTime, String bqh, String ksh);

    List<Reserve> getDiningTableDetails(String ksh, String dinner, String dcTime, String useTimes);

    String getMaxUseTimes(Map<String, Object> params);

    Integer updateUseTimes(Map<String, Object> params);
}
